1. Field of the Invention
This invention relates to colour correction.
2. Description of the Prior Art
Colour correction is a technique used in the production of image or video material to replace occurrences of certain colours in original material with corresponding replacement colours. Two examples of when this process might be needed are to match the appearance of scenes shot under different lighting conditions, or simply to change the appearance of an image for artistic reasons. Particularly in the context of this second example, it will be understood that the term “correction” does not imply that there was necessarily anything intrinsically wrong with the original colour; the way that the expression “colour correction” is used in the art (and in the present application) is in fact with the more generic meaning of “colour alteration”.
The colour properties of an image are usually considered in one of the following representations, often referred to as “colour spaces”: as a set of contributions from primary colours (e.g. RGB—red, green and blue), as a luminance value (L) plus two colour difference values (e.g. Cb, Cr) or as a luminance value (L), a hue value (H) and a saturation value (S). In real images (rather than test patterns) what is perceived as a “colour” does not correspond to a single point in colour space and so cannot generally be defined as a precise, single, set of such values. Instead, what the viewer may perceive as a single “colour” would typically occupy a range of values in colour space. For example, an image of, say, a red car would have a range of “red” values depending on the local lighting, angle and even cleanliness of each area of the car. So, in order to apply colour correction to the “red” of the car, in fact a region in colour space is defined to encompass all of the “red” colour exhibited by the car. A processing operation is then applied to map that source region to another similar (target) region elsewhere in colour space. By mapping the whole region in this way, variations in shade are mapped to corresponding variations in shade at the target region.
The colour correction may thus alter one or more of the colour properties of the image. For example, hue could be altered without changing the saturation and intensity values.
Colour correction is usually carried out in the digital domain. U.S. Pat. No. 6,434,266 discloses a digital colour correction system in which each pixel value of a source image is converted from an RGB representation into an HSL representation. The HSL values are compared—pixel by pixel—with a range of HSL values defined as a source range of “colours to be corrected”. If a pixel is found to lie within the source range, that pixel is replaced by a pixel value in a “target” colour range.
The source range or locus in colour space may be associated with a “key”. Where the key is full on (e.g. a value of one) the complete colour correction is applied. Where it is off (e.g. a value of zero), no correction is applied. In between these two extremes, the key can describe the amount of change to be applied. In this way, so-called soft edges may be produced at the periphery of the colour corrected regions of colour space.
In order to use the key value, the following example logic may be used. First, for the HSL position in colour space of a current pixel, the key value k is established. Then, for an additive change to luminance or saturation, the change is implemented as:new value=old value+k·deltawhere delta is equal to the full amount of a desired change (i.e. the change which would occur where k=1).
The simple logic above works well to create additive delta changes in Luminance and Saturation. However, hue changes are more difficult. It is not possible to simply apply a hue change in the rectangular CbCr domain using a CbCr additive vector translation. Though this works for spot colour correction, it results in the wrong output value of saturation when larger regions of colour space are corrected.
Changes in hue are preferably applied using a rotation of the existing hue. When in the HSL domain this is a simple addition to the existing, input, hue. However, in soft areas (parts of colour space for which 0<k<1) undesirable colour “rainbow” effects are experienced, in that the hue rotation causes the transition to the new colour to pass through many similarly saturated additional colours. In soft areas it is more desirable for the softness to describe a straight line on the CbCr plane between the original and corrected colour. That is to say that in softness areas saturation changes as well as hue, in dependence on the key value.
So, there is a conflict of requirements. Where k=1, hue changes are better carried out in the HSL domain. However, where 0<k<1, i.e. in “soft” areas, hue changes are better carried out as a straight line translation in the CbCr domain. It is possible to overcome this conflict by producing the hardware needed to create a hue rotation, but operating in the Cb Cr domain, but this approach is very expensive in terms of processing overhead.